package itheima.anno;

import itheima.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import jakarta.validation.constraints.NotEmpty;

import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented
@Target({FIELD})//作用在字段上
@Retention(RUNTIME)//运行期
@Constraint(validatedBy = {StateValidation.class})//指定校验器
public @interface State {
    //提供校验失败的信息
    String message() default "";
    //指定分组
    Class<?>[] groups() default {};
    //负载，获取State的注解信息
    Class<? extends Payload>[] payload() default {};
}
